@extends('backend.template.bootstrap')
@section('content')
<div class="m-b-md">
	<h3 class="m-b-none">分类管理</h3>
</div>
<div class="row">
	<div class="col-lg-12">
		<ul class="breadcrumb">
			<li><a href="{{ url('backend') }}"><i class="fa fa-home"></i> 首页</a></li>
			<li class="active">分类管理</li>
		</ul>
	</div>
</div>
<section class="panel panel-default">
	<header class="panel-heading">小说分类</header>
	<div class="panel-body">
		<div class="panel-heading">
		<a href="{{ url('/backend/categories/create') }}" class="btn btn-primary btn-sm">创建分类</a>
		</div>
		<div class="table-responsive">
			<table class="table table-striped b-t b-light">
				<thead>
					<tr>
						<td width="100">顺序</td>
						<th>分类名</th>
						<th width="200">操作</th>
					</tr>
				</thead>
				<tbody>
					@foreach($categories as $category)
					<tr>
						<td class="text-muted">[ {{ $category->order }} ]</td>
						<td>{{ $category->name }}</td>
						<td>
							{!! Form::open(array('method' => 'DELETE', 'route' => array('categories.destroy', $category->id), 'class' => 'inline')) !!}
								<a href="#" onclick="if(confirm('确定删除吗？')){$(this).parent('form').submit();}">删除</a>
							{!! Form::close() !!}
						</td>
					</tr>
					@endforeach
				</tbody>
			</table>
		</div>
	</div>
</section>
@stop